{% extends 'app01/admin/home.html' %}


{% block content %}
<div class="text-center">
        <h2>{{ role }}搜索结果</h2>
    </div>
    <hr>
    {% for ob in obj %}
        {% if choice == '100' and obj.username != 'admin' %}
            <div class="media">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object" src="/media/{{ ob.avatar }}" alt="..." height="64">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading">{{ ob.username }}</h4>
                    <a href="/app01/site/{{ ob.username }}/"> 进入{{ ob.username }}的个人站点 </a>
                </div>
            </div>
            <hr>
        {% elif choice == '200' %}<!--文章-->
            <div class="media">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object" src="/media/{{ ob.blog.userinfo.avatar }}" alt="..." height="64">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading"><a href="/app01/site/{{ ob.blog.userinfo.username }}/article/{{ ob.pk }}/" target="_blank">{{ ob.title }}</a></h4>
                    <p> {{ ob.desc }} </p>
                </div>
            </div>


        {% elif choice == '300' %}
             <div class="media">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object" src="/media/{{ ob.userinfo.avatar }}" alt="..." height="64">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading"><a href="/app01/preview_file/?file_id={{ ob.pk }}&url={{ request.get_full_path_info }}" target="_blank" >{{ ob.name }}</a></h4>
                    <p> {{ ob.desc }} </p>
                </div>
            </div>
        {% elif choice == '10' %}
            <div class="media">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object" src="/media/{{ ob.avatar }}" alt="..." height="64">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading"><a href="/app01/site/{{ ob.username }}/" target="_blank" >{{ ob.username }}</a></h4>
                    <p> 所属班级：{{ ob.stu_class }} </p>
                </div>
            </div>
             {% elif choice == '11' %}
            <div class="media">
             <div class="media-left">
                    <a href="#">
                        <img class="media-object" src="/media/{{ ob.uploader.avatar }}" alt="..." height="64">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading"><a href="/app01/site/{{ ob.uploader.username }}/" target="_blank" >{{ ob.uploader.username }}</a></h4>
                    <p> 资源名称：{{ ob.name }} </p>
                <p><a href="/app01/site/{{ ob.uploader.username }}/source_detail/{{ ob.pk }}/?pk={{ ob.pk }}&url={{ request.get_full_path }}">资源描述：{{ ob.descn }}</a></p>
                </div>
            </div>

        {% endif %}
    {% empty %}
        没有搜索到，请换个关键词。
    {% endfor %}

{% endblock %}


{% block js %}

{% endblock %}
